package cn.pfund.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

 /**
 *新闻类别
 * @author zhaominglei qq:351024274，专注于网站、app和游戏开发。
 * @date 2017年1月20日
 */
@Entity
@Table(name="pfund_news_type")
public class NewsType extends OrderEntity implements Serializable {
	private static final long serialVersionUID = 4889502232749505651L;
	/** 类别 **/
	private String type;
	/** 网址 **/
	private String url;
	/** 新闻管理 */
	private Set<News> newsSet = new HashSet<News>();

	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@OneToMany(mappedBy="newsType", fetch=FetchType.LAZY, cascade = CascadeType.REMOVE)
	@OrderBy("createDate desc")
	public Set<News> getNewsSet() {
		return newsSet;
	}
	public void setNewsSet(Set<News> newsSet) {
		this.newsSet = newsSet;
	}
}
